using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

/// <summary>
/// r g:存储郡块ID
/// b通道标识解锁程度
/// </summary>
public class WarFogUtil
{
    public static Color32 ConvertInt2Color(int value)
    {
        var r = (byte)(value & 0xFF);
        var g = (byte)((value >> 8) & 0xFF);
        var b = (byte)((value >> 16) & 0xFF);
        var a = (byte)((value >> 24) & 0xFF);
        return new Color32(r, g, b, a);
    }

    public static int ConvertColor2Int(Color32 value)
    {
        var result = value.r | value.g << 8 | value.b << 16 | value.a << 24;
        return result;
    }

    public static Color EncodeArea(int id)
    {
        return ConvertInt2Color(id);
    }
}
